<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html>
<html>
<head>
<base href="<%=basePath%>">

<title>电子文档系统</title>
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<script type="text/javascript" src="view/jquery/jquery-1.9.1.js"></script>
<script type="text/javascript" src="view/bootstrap/js/bootstrap.js"></script>
<link rel="stylesheet" href="view/bootstrap/css/bootstrap.css">
<link rel="stylesheet" href="view/css/docMan.css">
<link rel="stylesheet" href="view/css/font-awesome.min.css">
<link rel="stylesheet" href="view/css/buttons.css">
<link rel="stylesheet" href="view/toastr/toastr.css">
<script type="text/javascript" src="view/js/docMan.js"></script>
<script type="text/javascript" src="view/toastr/toastr.min.js"></script>
<script type="text/javascript" src="view/js/ajaxfileupload.js"></script>
<link rel="stylesheet" href="zcfg/css/menu_left.css" media="screen" />
<style type="text/css">
.bookSon{
	cursor: pointer;
}
	#menu{
		width: 500px;
		margin-left:20px;
	}
	#menu ul {
	padding-left: 0px;
	/* height: 300px; */
	height:auto;
	border: #E7E7E7 0px solid;
	border-top: none;
	overflow: auto;
	}
	#menu span{
		padding:4px 4px;
		/* min-height:25px; */
		font-size: 14px;
	}
	#menu span:HOVER {
		background-color: #277fc2;
		font-color: #fff;
		color: #fff;
	}
	.select{
		background-color: #277fc2;
		font-color: #fff;
		color: #fff;
	}
	.dbclick{
		background-color: #277fc2;
		font-color: #fff;
		color: #fff;
	}
</style>
</head>
<body style="background: #EDEFF0;">
	<div id="main-container" class="container"
		style="height: 100%;width:100%;background: #EDEFF0;">
		<div class="row" style="height: 100%;">
			<div class="col-md-6">
				<div class="row bookList" style="width:100%;padding-left:20px;min-height: 500px;">
					<div id="menu">
						<ul>
							<s:iterator value="bookSonPage.result" id="bookSon" status="stu">
								<li >
									<span id='<s:property value="#bookSon.id"/>' class="bookSon" style="display:block;">
										<span class="glyphicon glyphicon-plus" style="float:left; font-family:-webkit-pictograph;" aria-hidden="true"></span>
										<p style='float:left;' class="orderId" id="<s:property value="#bookSon.orderId" />">[<s:property value="#bookSon.orderId" />]</p><p class="subTitle" style="font-size:12px;"><s:property value="#bookSon.subTitle"  /></p> 
									</span> 
								</li>
							</s:iterator>
						</ul>
					</div>
					<!--分页按钮  -->
					<div class="row" style="margin-top: 20px;margin-bottom: 20px;">
						<form id="bookSon" name="bookSon" action="bookSon.action"
							method="get">
							<button class="btn btn-link prePage"
								<s:if test='bookSonPage.hasPrePage==false' >disabled="disabled"</s:if>>上一页</button>
							<input type="number" formtarget="bookSon"
								onkeydown='if(event.keyCode==13){gosubmit();}' form="bookSon"
								id="currentPage" name="bookSonPage.currentPage"
								value='<s:property value="bookSonPage.currentPage" />'
								style="width:80px;display: inline;" class="form-control">
							<%-- <input type="number" id="currentPage" name="bookSonPage.currentPage" value='<s:property value="bookSonPage.currentPage"/>' style="display: none;"> --%>
							<input id="totalPage"
								value='<s:property value="bookSonPage.totalPage" />'
								style="display: none;">
							<button class="btn btn-link nextPage" type="button"
								<s:if test='bookSonPage.hasNextPage==false' >disabled="disabled"</s:if>>下一页</button>
							共<span class="pageCount"><s:property
									value="bookSonPage.totalPage" /> </span>页，
							<s:property value="bookSonPage.totalCount" />
							条记录 <input type="hidden" id="orderByTimeField"
								name="bookSonPage.orderByTime"
								value='<s:property value="bookSonPage.orderByTime" />'> <input
								type="hidden" id="isqtlwdw" name="isqtlwdw"
								value='<s:property value="isqtlwdw" />'> <input
								type="hidden" id="qtlwdw" name="qtLwdw"
								value='<s:property value="qtLwdw" />'>
								<s:if test="#session.admin==true">
									<button class="btn btn-primary" type="button " id="addBookSonModalDingji" style="margin-left:20px;">添加资料目录</button>
									<button class="btn btn-primary bookSonSee" >查看</button>
									<button class="btn btn-primary bookSonEdit" type="button" style="margin-left:20px;">编辑</button>
										<button class="btn btn-primary btn-bookSonAddModal" type="button" style="margin-left:20px;">添加子目录</button>
										<button class="btn btn-danger bookSonDel" type="button"  style="margin-left:20px;">删除</button>
										<button class="btn btn-primary addBookSonModal" type="button"   style="margin-left:20px;">上传</button>
								</s:if>
								
								
						</form>
					</div>
				</div>
			</div>
			<div class="col-md-6" style="height:100%;overflow:scroll;min-height:900px;min-width: 200px;">
				<iframe id="bookSonEditIframe" scrolling="yes" frameborder="no" style="min-height: 1200px;" width="100%" height="100%">
				
				</iframe>
			</div>
		</div>
		
	</div>
	
	<div class="modal fade" id="editBookSonModal" tabindex="-1" role="dialog"
		aria-labelledby="exampleModalLabel">
		<div class="modal-dialog" role="document">
			<form >
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal"
							aria-label="Close">
							<span aria-hidden="true">&times;</span>
						</button>
						<h4 class="modal-title" id="boolTitle">编辑书本</h4>
					</div>
					<div class="modal-body">
						<div class="form-group">
							<label for="directoryName" class="control-label">目录的排序序号:</label>
							<input type="number" class="form-control" id="editOrderNumber" placeholder="目录的排序序号"  >
						</div>
						<div class="form-group">
							<label for="bookName" class="control-label">书本名:</label> <input
								type="text" class="form-control" id="editBookSonName">
						</div>
						<input type="hidden" id="editBookSonId" value="" >
					</div>
					<div class="modal-footer">
						<button type="button" id="btn_editBookSon" class="btn btn-primary">保存</button>
						<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
					</div>
				</div>
			</form>
		</div>
	</div>
	
	<div class="modal fade" id="delBookSonModal" tabindex="-1" role="dialog"
		aria-labelledby="exampleModalLabel">
		<div class="modal-dialog" role="document">
			<form >
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal"
							aria-label="Close">
							<span aria-hidden="true">&times;</span>
						</button>
						<h4 class="modal-title" id="boolTitle">删除书本</h4>
					</div>
					<div class="modal-body">
						书本名:<span id="delBookSonName"></span>
						<input type="hidden" id="delBookSonId" value="" >
					</div>
					<div class="modal-footer">
						<button type="button" id="btn_delBookSon" class="btn btn-primary">删除</button>
						<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
					</div>
				</div>
			</form>
		</div>
	</div>

	<div class="modal fade" id="addBookModal" tabindex="-1" role="dialog"
		aria-labelledby="exampleModalLabel">
		<div class="modal-dialog" role="document">
			<form >
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal"
							aria-label="Close">
							<span aria-hidden="true">&times;</span>
						</button>
						<h4 class="modal-title" id="boolTitle">新建书本</h4>
					</div>
					<div class="modal-body">
						<div class="form-group">
							<label for="bookName" class="control-label">书本名:</label> <input
								type="text" class="form-control" id="bookName">
						</div>
					</div>
					<div class="modal-footer">
						<button type="button" id="btn_addBook" class="btn btn-primary">添加</button>
						<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
					</div>
				</div>
			</form>
		</div>
	</div>
	
	<div class="modal fade" id="uploadFileModal" tabindex="-1" role="dialog"
		aria-labelledby="exampleModalLabel">
		<div class="modal-dialog" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					<h4 class="modal-title" id="exampleModalLabel">上传文件</h4>
				</div>
				<div class="modal-body">
					
					<input type="file" name="oafile" id="upFile" onchange="uploadfile();" style="height: 0px;width: 0px;">
					<div class="row ">
						<div class="col-xs-2" >
							<div style="float: right">
								<span style="color:red;" >* </span>文件：
							</div>
						</div>
						<div  class="col-xs-9">
							<div id="fileUploadList" class="">
								<%-- <div class="row file">
									<div class="col-xs-6">
										<span class=""> 2012新生名单分班人数8月2 </span>
									</div>
									<div class="col-xs-4">
										<span class="muted fileSize"> (1.78M) </span>
										<button  class="btn btn-link padding_clear ">删除</button>
									</div>
								</div> --%>
							</div>
							<div class="row">
								<i class="commpic-attach"></i>
								<button id="" onclick="clickinput();" class="btn btn-link">上传文件</button>
							</div>
							<div class="form-group">
								<!-- <label for="bookName" class="control-label">书本目录名:</label> <input
									type="text" class="form-control" id="bookSonName" style="width:350px;" id="bookName"> -->
							</div>
						</div>
					</div>
				</div>
				<div class="modal-footer">
					<button type="button" id="btn-addBookSon" class="btn btn-primary">上传</button>
					<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
				</div>
			</div>
		</div>
	</div>
	<!-- 添加子目录 -->
	<div class="modal fade" id="bookSonAddModal" tabindex="-1" role="dialog"
		aria-labelledby="exampleModalLabel">
		<div class="modal-dialog" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					<h4 class="modal-title" id="exampleModalLabel">添加子目录</h4>
				</div>
				<div class="modal-body">
					<form>
						<div class="form-group">
							<label for="directoryName" class="control-label">目录的排序序号:</label>
							<input type="number" class="form-control" id="orderNumber" placeholder="目录的排序序号"  >
						</div>
						<div class="form-group">
							<label for="dirRange" class="control-label">目录名字:</label> 
							<input type="text" class="form-control" id="bookSonTitle" placeholder="目录名字"  >
							</select>
						</div>
						
					</form>
				</div>
				<div class="modal-footer">
					<button type="button" id="btn-bookSon-creat" class="btn btn-primary">添加</button>
					<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
				</div>
			</div>
		</div>
	</div>
<!-- 添加顶级bookSon的modal -->	
	<div class="modal fade" id="bookSonAddModalDingji" tabindex="-1" role="dialog"
		aria-labelledby="exampleModalLabel">
		<div class="modal-dialog" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					<h4 class="modal-title" id="exampleModalLabel">添加子目录</h4>
				</div>
				<div class="modal-body">
					<form>
						<div class="form-group">
							<label for="directoryName" class="control-label">目录的排序序号:</label>
							<input type="number" class="form-control" id="orderNumberDingji" placeholder="目录的排序序号"  >
						</div>
						<div class="form-group">
							<label for="dirRange" class="control-label">目录名字:</label> 
							<input type="text" class="form-control" id="bookSonTitleDingji" placeholder="目录名字"  >
							</select>
						</div>
						
					</form>
				</div>
				<div class="modal-footer">
					<button type="button" id="btn-bookSon-creat-dingji" class="btn btn-primary">添加</button>
					<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
				</div>
			</div>
		</div>
	</div>
	<input type="hidden" id="isAdmin" value="${admin}"  >
	<input type="hidden" id="bookId" >
	<input type="hidden" id="fatherBookId" >
</body>

<script type="text/javascript">
	var height = getWindowHieght() * 0.9;
	var width = getWindowWidth() * 0.6;
	$("#pdfModal").css("height", height);
	$("#pdfModal").css("width", width);
	$("#pdf").css("height", height);
	$("#pdf").css("width", width * 0.98);
	$("#closePdf").on("click", function() {
		$("#pdfModal").toggle(400);
	});
	$("#btn-bookSon-creat").on("click",function(){
		var bookSubTitle=$("#bookSonTitle").val();
		var orderId=$("#orderNumber").val();
		var bookSonId=$("#bookId").val();
		$.ajax({
			type:"post",
			url:"/DocMan/webService/show/DocBookSon/addBookSonDirectory",
			data:{bookSonId:bookSonId,fatherId:0,bookSonTitle:bookSubTitle,orderId:orderId,isDirectory:1},
			success:function(data){
				console.info(data)
				refresh();
			},
			error:function(data){
			}
		});
	});
	$("#btn-bookSon-creat-dingji").on("click",function(){
		var bookSonId=0;
		var bookId=0;
		bookId=$("#fatherBookId").val();
		var bookSubTitle=$("#bookSonTitleDingji").val();
		var orderId=$("#orderNumberDingji").val();
		var isDirectory=1;
		$.ajax({
			type:"post",
			url:"/DocMan/webService/show/DocBookSon/addBookSonDirectory",
			data:{bookSonId:bookSonId,fatherId:bookId,bookSonTitle:bookSubTitle,orderId:orderId,isDirectory:isDirectory},
			success:function(data){
				console.info(data);
				refresh();
			},
			error:function(data){
			}
		});
	});
	/**
	添加子目录的子目录
	**/
	$("#btn-addBookSon-directory").on("click",function(){
		var bookSonId=0;
		var bookId=0;
		bookId=$("#fatherBookId").val();
		var bookSubTitle=$("#bookSonTitleDingji").val();
		var orderId=$("#orderNumberDingji").val();
		var isDirectory=1;
		$.ajax({
			type:"post",
			url:"/DocMan/webService/show/DocBookSon/addBookSonDirectory",
			data:{bookSonId:bookSonId,fatherId:bookId,bookSonTitle:bookSubTitle,orderId:orderId,isDirectory:isDirectory},
			success:function(data){
				console.info(data);
				refresh();
			},
			error:function(data){
			}
		});
	});
	
	/**
	添加书本的子目录
	**/
	$(".bookList").on("click",".btn-bookSonAddModal",function(){
		var bookSonId=0;
		if($(".select").length==0){
			toast.error("请选中目录", "温馨提示");
			return false;
		}else{
			bookSonId=$(".select").attr("id");
			
		}
		$("#bookSonAddModal").modal("show");
		$("#bookId").val(bookSonId);
		return false;
	})
	$(".bookList").on("click",".bookSon",function(){
		var bookSonId=$(this).attr("id");
		console.info($(".group"+bookSonId).length);
		var fatherClass="group"+bookSonId;
		var li=$(this).closest("li");
		showplusmins($(this));
		if($(this).hasClass("select")){
			$(".bookSon").removeClass("select");
		}else{
			$(".bookSon").removeClass("select");
			$(this).addClass("select");
		}
		var url="bookSonNEditView.action?bookSonId="+bookSonId;
		$("#bookSonEditIframe").attr('src', url);
		if($(li).find("ul").length==0){
			$.ajax({
				type:"post",
				data:{bookSonId:bookSonId},
				url:"/DocMan/webService/show/DocBookSon/getSubBookSon",
				success:function(data){
					console.info(data)
					var isAdmin=$("#isAdmin").val();
					var groupClassId="group"+bookSonId;
						var s="<ul style=\"margin-left:10px;\">";
							$(data["bookSons"]).each(function(i,ele){
								s=s+"<li ><span class='bookSon' value="+ele.orderId+" id="+ele.id+" title=\"双击查看文档\"  style=\"display:block;margin-left:15px;\"> <span class=\"glyphicon glyphicon-plus\" style=\"float:left; font-family:-webkit-pictograph;\" aria-hidden=\"true\"></span> "+
							"<p style='float:left;' class=\"orderId\" id=\""+ele.orderId+"\">["+ele.orderId+"]</p><p class=\"subTitle\" style=\"font-size:12px;\">"+ele.subTitle+"</p></span></li>";
							});
							s=s+"</ul>";
						$(li).append(s);
				},
				error:function(data){
					toast.error("请求失败", "温馨提示");
				}
			});
		}else{
			$(li).find("ul").toggle(500);
		}
		
	});
	$(".bookList").on("click",".bookSonEdit",function(){
		if($(".select").length==0){
			toast.error("请选中目录", "温馨提示");
			return false;
		}
		var bookSonId=$(".select").attr("id");
		//var id=$(this).attr("id");
		$("#editBookSonId").val(bookSonId);
		var bookName=$(".select").find(".subTitle").text();
		var bookOrderId=$(".select").find(".orderId").attr("id");
		$("#editBookSonName").val(bookName);
		$("#editOrderNumber").val(bookOrderId);
		$("#editBookSonModal").modal("show");
		return false;
	});
	$("#btn_editBookSon").on("click",function(){
		var bookSonName=$("#editBookSonName").val();
		var id=$("#editBookSonId").val();
		var bookOrderId=$("#editOrderNumber").val();
		$.ajax({
			type:"post",
			url:"/DocMan/webService/show/DocBookSon/editBookSon",
			data:{bookSonId:id,bookSonName:bookSonName,orderId:bookOrderId},
			success:function(){
				refresh();
			},
			error:function(){
			}
		})
	});
	$("#btn_delBookSon").on("click",function(){
		var id=$("#delBookSonId").val();
		$.ajax({
			type:"post",
			url:"/DocMan/webService/show/DocBookSon/delBookSon",
			data:{bookSonId:id},
			success:function(){
				refresh();
			},
			error:function(){
			}
		})
	});
	
	$(".bookList").on("click",".bookSonDel",function(){
		if($(".select").length==0){
			toast.error("请选中目录", "温馨提示");
			return false;
		}
		var bookSonId=$(".select").attr("id");
		//var id=$(this).attr("id");
		$("#delBookSonId").val(bookSonId);
		var bookName=$(".select").find(".subTitle").text();
		$("#delBookSonName").text(bookName);
		$("#delBookSonModal").modal("show");
	})
	$(".btn_look_pdf").on("click", function() {
		parent.hideleft();
		var id = $(this).attr("id");
		var url = "/DocMan/dowloadFile.action?indexFrom=1&id=" + id;
		/* $("#pdf").attr("src",url);
		$("#pdfModal").toggle(400); */
		var height = $(window).height();
		var width = $(window).width();
		var pdf = $("#pfdModal");
		$("#pdfIframe").attr('src', url);
		$("#jnmlModal").modal('hide');
		pdf.find(".modal-body").css({
			height : height - 40
		});
		pdf.find(".modal-dialog").css({
			width : width,
			height : height,
			margin : 0
		});
		pdf.modal('show').css({
			width : width,
			height : height
		});
	});
	$("#hidepdf").on("click", function() {
		parent.showleft();
		$("#pfdModal").modal('hide');
	})
	$(".prePage").on("click", function() {
		var pageCount = Number($("#currentPage").val()) - 1;
		$("#currentPage").val(pageCount);
		$("#bookSon").submit();
	});
	$(".nextPage").on("click", function() {
		var pageCount = Number($("#currentPage").val()) + 1;
		$("#currentPage").val(pageCount);
		console.info($("#currentPage").val());
		$("#bookSon").submit();
	});
	$("#btn_addBookModal").on("click",function(){
		$("#addBookModal").modal("show");
		
	});
	$("#btn_addBook").on("click",function(){
		var bookName=$("#bookName").val();
		if(bookName==''||bookName==undefined||bookName==null){
			toast.error("请输入书本的标题", "温馨提示");
			return false;
		}
		
		$.ajax({
			type:"post",
			url:"/DocMan/webService/show/DocBookService/addBook",
			data:{bookName:bookName,bookId:0},
			success:function(){
				refresh();
			},
			error:function(){
			}
		})
	});
	$(".bookList").on("click",".addBookSonModal",function(){
		if($(".select").length==0){
			toast.error("请选中目录", "温馨提示");
			return false;
		}
		var bookSonId=$(".select").attr("id");
		var height = $(window).height();
		var width = $(window).width();
		var pdf = $("#uploadFileModal");
		$("#bookId").val(bookSonId);
		pdf.modal('show');
		return false;
	});
	$("#addBookSonModalDingji").on("click",function(){
		var height = $(window).height();
		var width = $(window).width();
		var pdf = $("#bookSonAddModalDingji");
		var fatherBookId=string.getUrlParam("bookId");
		$("#fatherBookId").val(fatherBookId);
		/* pdf.find(".modal-body").css({
			height : height-100
		});
		pdf.find(".modal-dialog").css({
			width : width,
			height : height,
			margin : 0
		}); */
		pdf.modal('show');/* .css({
			width : width,
			height : height
		}); */
		return false;
	});
	
	$("#btn-addBookSon").on("click", function() {
		var bookSonName = $("#bookSonName").val();
		//var bookId = $("#bookId").val();
		var bookSonId=0;
		if($(".select").length==0){
			toast.error("请选中目录", "温馨提示");
		}else{
			bookSonId=$(".select").attr("id");
			
		}
		var filePathsBtn = $("#fileUploadList").find(".filePath");
		var filePaths = new Array();
		$(filePathsBtn).each(function(i, e) {
			filePaths[i] = e.value;
		});
		if(filePaths.length==0)
		{
			return false;
		}
		$.ajax({
				type : "post",
				url : "/DocMan/webService/show/DocBookSon/setBook",
				traditional : true,
				data : {
					filePaths : filePaths,
					bookSonId : bookSonId,
					isDirectory:0,
					fatherBookId:0
				},
				success:function(data){
						refresh();
				},
				error:function(){
				}
		});
	});
	$(".bookList").on("click",".bookSonSee",function(){
		if($(".select").length==0){
			toast.error("请选中目录", "温馨提示");
			return false;
		}
		var bookSonId=$(".select").attr("id");
		 parent.showPdf(bookSonId);
		 return false;
	});
	function uploadfile() {
		var name = $("#upFile").val();
		var index = name.lastIndexOf("\\");
		var fileName = name.substring(index + 1, name.length);
		var indexsuffix=fileName.lastIndexOf(".");
		var fileNameNosuffix=fileName.substring(0,indexsuffix);
		$("#input_bookSonName").val(fileNameNosuffix);
		var file = document.getElementById('upFile').files[0];
		var fileSize = "";
		if (file.size > 1024 * 1024)
			fileSize = (Math.round(file.size * 100 / (1024 * 1024)) / 100)
					.toString()
					+ 'MB';
		else
			fileSize = (Math.round(file.size * 100 / 1024) / 100).toString()
					+ 'KB';
		console.info(name + fileSize + fileName);
		$.ajaxFileUpload({
					url : "asynUpload.action",
					secureuri : false,
					fileElementId : 'upFile',
					dataType : 'json',
					success : function(data, status) {
						console.info(data);
						var filePath = data.filePath;
						console.info(filePath);
						var file = "<div class=\"row file\">"
								+ "<div class=\"col-xs-6\">"
								+ "<span class=\"\">"
								+ fileName
								+ "</span>"
								+ "</div>"
								+ "<div class=\"col-xs-4\">"
								+ "<span class=\"muted fileSize \" id=\""+fileSize+"\"> ("
								+ fileSize
								+ ") </span>"
								+ "<button value=\""+filePath+"\" class=\"btn btn-link padding_clear filePath\">删除</button>"
								+ "</div>" + "</div>";
						$("#bookSonName").val(fileName);
						$("#fileUploadList").append(file);
						//$("#serverFilePath").val(filePath);
					},
					error : function(data, status) {
						console.info(data);
					}
				});
	}
	function clickinput() {
		return $("#upFile").click();
	}
		function showplusmins(span){
		console.info($(span).find("span").hasClass("glyphicon-plus"));
		if($(span).find("span").hasClass("glyphicon-plus")){
			$(span).find("span").removeClass("glyphicon-plus");
			$(span).find("span").addClass("glyphicon-minus");
		}else{
			$(span).find("span").addClass("glyphicon-plus");
			$(span).find("span").removeClass("glyphicon-minus");
		}
	}
</script>
</html>
